<template>
	<view class="container">
		<view class="video_box">
			<!-- <video id="myVideo" :src="video_url" object-fit="fill" loop="false" autoplay="false" page-gesture="true"
				controls="true"></video> -->
		</view>
	</view>
</template>

<script>
	import api from './video.js'
	export default {
		data() {
			return {
				video: {},
				video_url: "",
			}
		},
		onLoad(option) {
			let videoJson = decodeURIComponent(option.video);
			this.video = JSON.parse(videoJson);
			uni.setNavigationBarTitle({
				title: this.video.r_title,
			})
			//分享	// 微信小程序分享功能
			this.share.title=this.video.r_title;
			this.share.path= '/pages/video/video?video=' + encodeURIComponent(JSON.stringify(this.video));
			uni.showShareMenu({
				withShareTicket:true,
				menus: ["shareAppMessage", "shareTimeline"] //不设置默认发送给朋友
			})
			//end
		},
		onReady() {
			this.getVideo();
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			async getVideo() {
				let res = await api.getResourcevideo(this.video.r_res_id);
				this.video_url = res.data.data;
			},
		}
	}
</script>

<style lang="scss">
	@import "@/common/title_bar.css";
	@import "./video.scss";
</style>
